public class demo17 {
    public static void main(String[] args) {
        Singleton singleton = Singleton.getInstance();
        Object object = new Object();

    }


}

class Singleton {
    private static Singleton instance = new Singleton();

    public static Singleton getInstance()
    {
        return instance;
    }
    //单例模式---饿汉模式
    private Singleton() {
    }

}
